package com.xsomnus.java_basic.juc.exceptions;

import java.util.concurrent.Callable;

/**
 * @author @叶小夏
 * @since 2019/7/29 0029 17:25
 * - 才需学也,学需静也/非淡泊无以明志，非宁静无以致远
 */
public class SubThread implements Callable<String> {
    @Override
    public String call() throws Exception {

        System.out.println("do something -- 1");
        exceptionMethod();
        System.out.println("do something -- 2");
        return "success";
    }

    private void exceptionMethod() {
        throw new RuntimeException("子线程异常，手动抛出");
    }

}
